package org.googlecode.viewt.core.tools.formbean;

import org.googlecode.viewt.core.tools.po.POConfigUtil;

public class ConstantGenerator extends BaseFormBeanGenerator {
	private boolean generated = false;

	public String getLoggerCategory() {
		return "ConstantGenerator";
	}

	public String getTemplate(String className) throws Exception {
		return "java_CONST.vm";
	}

	public String getOutputFile(String className) throws Exception {
		if (!(this.generated)) {
			this.generated = true;
		}
		return POConfigUtil.fullJavaFileName(getDestPath(), FormBeanUtil
				.constClass(getRepository().getPrePackName(), getRepository()
						.getMainDef().getProjectName(), getRepository()
						.getMainDef().getModuleName()));
	}

	public boolean needGenerate(String className) throws Exception {
		return (!(this.generated));
	}

	public void setupContext() throws Exception {
	}

	public void setupContext(String className) throws Exception {
	}

	public void cleanContext(String className) throws Exception {
	}

	public void cleanContext() throws Exception {
	}
}